package tech.aistar.prj.service.impl;

import org.apache.ibatis.session.SqlSession;
import tech.aistar.prj.entity.User;
import tech.aistar.prj.mapper.UserMapper;
import tech.aistar.prj.service.IUserService;
import tech.aistar.prj.util.MybatisUtil;

/**
 * 本类功能:
 *
 * @author cxylk
 * @date 2020/9/16 11:28
 */
public class UserServiceImpl implements IUserService {
    @Override
    public User login(String username){
        SqlSession sqlSession= MybatisUtil.getSqlSession();
        UserMapper userMapper=sqlSession.getMapper(UserMapper.class);
        User user=userMapper.finByUserName(username);
        sqlSession.close();
        return user;
    }
}
